import emiter from '@renderer/utils/mitt'
import { defineStore } from 'pinia'
import { type Object3D } from 'three'
import { ref, shallowRef } from 'vue'

export const useActiveObject = defineStore('activeObject', () => {
  const activeVO = ref<Object3D>()
  const activeShallowRef = shallowRef<Object3D>()

  function setActiveVO(obj: Object3D | undefined) {
    activeVO.value = obj
    activeShallowRef.value = obj
  }

  return { activeVO, activeShallowRef, setActiveVO }
})
